<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it">
<head>

	<title><$temp_title$> - Messaggi</title>

	<!-- FAVICON -->
	<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico"/>

	<!-- STYLE -->
	<link rel="stylesheet" href="libs/bootstrap/css/bootstrap.css" type="text/css" />
	<link rel="stylesheet" href="style/css/style.css" type="text/css" />
	<script src="libs/jquery/jquery-1.10.2.min.js"></script>
	<script type="text/javascript" src="libs/bootstrap/js/bootstrap.js"></script>
	<script>
	
		$(function() {
			$('.btn-cancel, .close').click(function () {
				$('.modal-body form').find(':input').each(function() {
					switch(this.type) 
					{
            			case 'password':
            			case 'select-multiple':
            			case 'select-one':
            			case 'text':
            			case 'textarea':
            			    $(this).val('');
                		break;
            			case 'checkbox':
            			case 'radio':
                			this.checked = false;
                	}
    			});
			});
			
		});
		
	</script>

</head>
<body>
	
<div class="container">
	<div class="row-fluid">
		<br />
		<$temp_msgbox$>
		
		<button class="btn btn-success" data-toggle="modal" data-target="#messageModal">Nuova Missiva</button>
		<button class="btn btn-primary" data-toggle="modal" data-target="#messageModal">Inviate</button>
		<button class="btn btn-danger" data-toggle="modal" data-target="#messageModal">Cancella selezionate</button>
		<button class="btn btn-danger" data-toggle="modal" data-target="#messageModal">Cancella tutte le Missive</button>
		
		<div class="input-group col-md-4 pull-right">
      		<input type="text" class="form-control">
      		<span class="input-group-btn">
        		<button class="btn btn-primary" type="button">Cerca</button>
      		</span>
    	</div>
		
		<$temp_form$>
		
		<table class="table table-striped table-bordered">
			<thead>
				<tr>
					<th>Ricevuto da</th><th>Data e Ora</th>
				</tr>
			</thead>
			<tbody>
				<$temp_msglist$>
			</tbody>
		</table>
	</div>
	
	<div class="modal fade" id="messageModal" data-backdrop="false" tabindex="-1" role="dialog" aria-labelledby="messageModalTitle" aria-hidden="true">
		
		<div class="modal-dialog">
			<div class="modal-content">
				
      			<div class="modal-header">
        			<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        			<h4 class="modal-title" id="messageModalTitle">Scrivi Messaggio</h4>
        		</div>
      			<div class="modal-body">
					<form action="mail.php?act=1" method="post" role="form">
						<div class="form-group">
							<label for="dest">Destinatario</label><input type="text" class="form-control" id="dest" name="user" value="<$temp_dest$>" />
						</div>
						<div class="form-group">
							<label for="msg">Testo</label><textarea class="form-control" id="msg" name="text" rows="8" cols="80"></textarea>
						</div>
						<input type="submit" class="btn btn-success" value="Invia">
					</form>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default btn-cancel" data-dismiss="modal">Annulla</button>
    			</div>
    			
    		</div>
		</div>
		
	</div>
</div>
	
	<$temp_jscript$>
	
</body>
</html>